package com.handydata.antifraud.port.impl;

import com.handydata.antifraud.port.NumInterface;
import com.handydata.common.util.RedisKey;
import com.handydata.common.util.RedisUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class NumInterfaceImpl implements NumInterface {

    private static final Logger logger = LoggerFactory.getLogger(NumInterfaceImpl.class);

    @Autowired
    private RedisUtil redisUtil;

    @Override
    public long getSum(String param) {
        long num = redisUtil.incr(RedisKey.CUST_TYPE_CODE_KEY+param, RedisKey.REDIS_NUM);
        logger.info("redis统计次数为:{}", num);
        return num;
    }
}
